/*
 * COPYRIGHT (C) 2010-2011
 * RE2, INC.
 *
 * Author: AM
 *
 * This file is a part of darm_example_ik, which was developed for the
 * DARPA ARM ROBOT Track C project.
 * 
 * darm_example_ik is free software:
 * you can redistribute it and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation, either version
 * 3 of the License, or (at your option) any later version.
 *
 * You should have received a copy of the GNU General Public License along
 * with this package.  If not, see <http://www.gnu.org/licenses/>.
 *
 * RE2, INC. disclaims all warranties with regard to this software, including
 * all implied warranties of merchantability and fitness, in no event shall
 * RE2, INC. be liable for any special, indirect or consequential damages or
 * any damages whatsoever resulting from loss of use, data or profits, whether
 * in an action of contract, negligence or other tortious action, arising out
 * of or in connection with the use or performance of this software.
 *
 */


#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

#include <ros/ros.h>

#include "re2darmSimExampleIK/DarmExampleIK.h"

using std::string;

void quit(int sig)
{
  
  usleep(100000);

  ros::shutdown();

  exit(0);
}

int main(int argc, char** argv)
{
  ros::init(argc, argv, "darm_example_ik");

  darmExampleIK tdk;
  if (tdk.init() == false) {
    ROS_FATAL("%s failed to initialize properly.", argv[0]);
    return(-1);
  }

  ros::AsyncSpinner spinner(1); // threaded spin function to handle callbacks
  spinner.start();
  signal(SIGINT,quit);

  tdk.keyboardLoop();

  ros::shutdown();
  return(0);
}
